package com.novax.ex.activity.provider.service;

import com.novax.ex.activity.infrastructure.entity.OperationUserLog;
import com.novax.ex.activity.infrastructure.entity.OperationV2Config;
import com.novax.ex.activity.infrastructure.mapper.OperationV2ConfigMapper;
import com.novax.ex.activity.infrastructure.mapper.OperationV2UserLogMapper;
import com.novax.ex.common.base.BaseMapper;
import com.novax.ex.common.base.BaseService;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;
import java.util.List;

/**
 * @Description 活动参与日志
 * @Author ChenXi
 * @Date 2023/04/18/10:08
 */

@Service
public class OperationV2UserLogService extends BaseService {

    @Resource
    private OperationV2UserLogMapper operationV2UserLogMapper;

    @Resource
    private OperationV2ConfigMapper operationV2ConfigMapper;

    @Override
    protected BaseMapper getBaseMapper() {
        return operationV2UserLogMapper;
    }

    /**
     * @Description: 查询用户是否参与过次活动
     * @Author: ChenXi
     * @Date:  2023/4/18 14:47
     * @param userId
     * @param customId
     * @return: java.lang.Integer
     **/
    public Long selectUserIdAndCustomId(Long userId, String customId) {
         return operationV2UserLogMapper.selectUserIdAndCustomId(userId, customId);
    }

    /**
     * @Description: 根据自定义id获得查询活动
     * @Author: ChenXi
     * @Date:  2023/4/20 11:04
     * @param customId
     * @return: void
     **/
    public OperationV2Config queryOperationIdByCustomId(String customId) {
        return operationV2ConfigMapper.queryOperationIdByCustomId(customId);
    }

    /**
     * @Description: 查询报名数据
     * @Author: ChenXi
     * @Date:  2024/5/6 10:12
     * @param id
     * @return: java.lang.Object
     **/
    public List<OperationUserLog> queryList(Long id) {
        return operationV2UserLogMapper.queryList(id);
    }

}
